home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
001-010
/
amok06
/
iffsupport
/
demos
/
copyiff.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
2KB
|
64 lines
(*---------------------------------------------------------------------------
:Program. CopyIFF.mod
:Author. Fridtjof Siebert
:Address. Nobileweg 67, D-7-Stgt-40
:Phone. 0711/822509
:Shortcut. [fbs]
:Version. 1.0
:Date. 27-Jul-88
:Copyright. PD
:Language. Modula-II
:Translator. M2Amiga
:Imports. IFFSupport [fbs].
:UpDate. none.
:Contents. Demonstration für IFFSupport. Lädt ein IFF-Bild und
:Contents. speichert es gepackt als test.iff ins actuelle Directory.
:Remark. Syntax: CopyIFF <filename>
---------------------------------------------------------------------------*)
MODULE CopyIFF;
FROM SYSTEM IMPORT ADR, ADDRESS, SHIFT, BITSET, LONGSET, CAST;
FROM Arguments IMPORT NumArgs,GetArg;
FROM Intuition IMPORT ScreenPtr,CloseScreen,DisplayBeep,WindowPtr;
FROM IFFSupport IMPORT ReadILBM,ReadILBMFlags,ReadILBMFlagSet,WriteILBMAll,
IFFInfo;
VAR
MyScreen: ScreenPtr; (* the Picture's ScreenPointer *)
WindowDummy: WindowPtr; (* only a dummy for NIL-Windowpointer *)
Name: ARRAY[0..79] OF CHAR; (* the Picture's Name *)
length: INTEGER; (* dummy for receiving Name's Length *)
Ciapra [0BFE001H]: SET OF (s0,s1,s2,s3,s4,s5,lmb);
(* Ciapra is a Hardware-Register. Bit #6 contains the left Button *)
BEGIN
(*------ Get Name: ------*)
IF NumArgs()#0 THEN
GetArg(1,Name,length);
ELSE
HALT; (* a silly guy didn't say which pic I should load *)
END;
(*------ Read and Save Pic: ------*)
IF ReadILBM(Name,ReadILBMFlagSet{front,visible},MyScreen,WindowDummy) THEN
IF NOT(WriteILBMAll("RAM:test.iff",ADR(IFFInfo),
MyScreen^.rastPort.bitMap,0,0,TRUE)) THEN
DisplayBeep(NIL);
END;
CloseScreen(MyScreen); (* close the Screen *)
ELSE
DisplayBeep(NIL); (* any error occured: lets display a Beep ! *)
END;
END CopyIFF. That's all. Wasn't that easy ???